package com.leapcloud.crm.core.dao;

import com.leapcloud.crm.core.jooq.tables.pojos.VtigerLeaddetails;
import org.jooq.DSLContext;
import org.springframework.stereotype.Component;

import java.util.List;

import static com.leapcloud.crm.core.jooq.tables.VtigerLeaddetails.VTIGER_LEADDETAILS;

/**
 * @author wangzhenyan
 * @date 2018/12/26下午6:32
 */
@Component
public class JooqDao {

  private final DSLContext dsl;

  public JooqDao(DSLContext dsl) {
    this.dsl = dsl;
  }

  public List<VtigerLeaddetails> findList() {
    List<VtigerLeaddetails> list = dsl.selectFrom(VTIGER_LEADDETAILS).limit(10).fetchInto(VtigerLeaddetails.class);
    return list;
  }
}
